package ch.fusun.baron.core.rmi;

/**
 * A user
 */
public class User {

	private final String userName;
	private final String password;

	/**
	 * Empty constructor
	 */
	public User() {
		userName = ""; //$NON-NLS-1$
		password = ""; //$NON-NLS-1$
	}

	/**
	 * Constructor
	 * 
	 * @param userName
	 *            The user name
	 * @param password
	 */
	public User(String userName, String password) {
		this.userName = userName;
		this.password = password;
	}

	/**
	 * The user name of the user
	 * 
	 * @return user name
	 */
	public String getName() {
		return this.userName;
	}

	@Override
	public boolean equals(Object arg0) {
		if (arg0 instanceof User) {
			return this.userName.equals(((User) arg0).getName());
		}
		return false;
	}

	@Override
	public int hashCode() {
		return userName.hashCode();
	}

	/**
	 * @return The password
	 */
	public String getPassword() {
		return this.password;
	}

}
